package com.auotc.livedatademo;

import android.arch.lifecycle.LiveData;
import android.util.Log;

/**
 * Created by lgs on 2019/4/18.
 */
public class MyData extends LiveData<String> {

    public static final String MY_TAG = "T3";

    public MyData() {
        setValue("hi");
    }

    @Override
    protected void onActive() {
        super.onActive();
        Log.i(MY_TAG, "onActive ");
    }

    @Override
    protected void onInactive() {
        super.onInactive();
        Log.i(MY_TAG, "onInactive ");
    }

    public void changeValue(String value) {
        setValue(value);
    }
}
